<template>
  <div id="app">
<!--v-show="$route.path!=='/detail/1'"-->
  <keep-alive exclude="Detail">

    <main-tab-bar v-if="header_show">
<!--<main-tab-bar>-->
  </main-tab-bar></keep-alive>
    <router-view @header="header" v-if="isRouterAlive"></router-view>
<!--<button @click="showNotify">尝试</button>-->
<!--    <van-field type="text"></van-field>-->
<!--    <van-button type=""></van-button>-->

  </div>
</template>

<style>

@import "assets/css/base.css";
</style>
<script>
  import MainTabBar from "@/components/content/MainTabBar";
  import Shop from "@/views/Shop/Shop";
  export default {
    name: 'app',
     provide () {    //父组件中通过provide来提供变量，在子组件中通过inject来注入变量。
            return {
                reload: this.reload
            }
        },
    components: {
      MainTabBar,
    },
    data(){
      return{
        show:'',
        header_show:true,
        isRouterAlive:true
      }
    },
    methods:{
      header(bool){
        this.header_show=bool
      },
        reload () {
                this.isRouterAlive = false;            //先关闭，
                this.$nextTick(function () {
                    this.isRouterAlive = true;         //再打开
                })
            }

    }
}

</script>
